package view.graph {	
	import controller.ControllerManager;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import view.graph.states.GraphExpansionType;
	import view.graph.states.GraphState;
	/**
	 * ...
	 * @author Anthony
	 */
	public class GraphStates
	{
		//------------------------------- statics ------------------------------\\
		private static var _self : GraphStates = new GraphStates();
		
		//------------------------------ variables -----------------------------\\
		private var _graphExpansionType : GraphExpansionType;
				
		//------------------------------ accessors -----------------------------\\
		public static function get self() 									: GraphStates 			{ return _self; }
		public function get graphExpansionType () 							: GraphExpansionType	{ return _graphExpansionType; }		
		public function set graphExpansionType (value : GraphExpansionType) : void					{ _graphExpansionType = value;																						
																									  reportGraphStateChange(_graphExpansionType); }
		
		//-------------------------- public functions --------------------------\\
		public function GraphStates()
		{
			if (_self)
				throw new Error("GraphStates can only be accessed through GraphStates.self");
			else
			{
				
			}
		}
		
		public function init() : void
		{
			_graphExpansionType = GraphExpansionType.EXTENDED;			
		}
		
		//------------------------- private functions --------------------------\\
		private function reportGraphStateChange(modifiedState : GraphState) : void
		{
			GraphManager.self.onGraphStateChange(modifiedState);
			ControllerManager.self.onGraphStateChange(modifiedState);
		}
	}	
}